<style lang="scss" scoped>
@import '../../style/mixin';
.loginContainer{
        padding-top: 1.95rem;
        p, span, input{
            font-family: Helvetica Neue,Tahoma,Arial;
        }
    }
.loginForm{
        background-color: #fff;
        margin-top: .6rem;
        .input_container{
            display: flex;
            justify-content: space-between;
            padding: .6rem .8rem;
            border-bottom: 1px solid #f1f1f1;
            input{
                @include sc(.7rem, #666);
            }
            button{
                @include sc(.65rem, #fff);
                font-family: Helvetica Neue,Tahoma,Arial;
                padding: .28rem .4rem;
                border: 1px;
                border-radius: 0.15rem;
            }
            .right_phone_number{
                background-color: #4cd964;
            }
        }
        .phone_number{
            padding: .3rem .8rem;
        }
        .captcha_code_container{
            height: 2.2rem;
            .img_change_img{
                display: flex;
                align-items: center;
                img{
                    @include wh(3.5rem, 1.5rem);
                    margin-right: .2rem;
                }
                .change_img{
                    display: flex;
                    flex-direction: 'column';
                    flex-wrap: wrap;
                    width: 2rem;
                    justify-content: center;
                    p{
                        @include sc(.55rem, #666);
                    }
                    p:nth-of-type(2){
                        color: #3b95e9;
                        margin-top: .2rem;
                    }
                }
            }
        }
    }
    .login_container{
            margin: 1rem .5rem 1rem;
            @include sc(.7rem, #fff);
            background-color: #4cd964;
            padding: .5rem 0;
            border: 1px;
            border-radius: 0.15rem;
            text-align: center;

        }

</style>

<template lang="html">

<div class="loginContainer">
    <head-top :head-title="'登录'"></head-top>
    <form class="loginForm">
        <section class="input_container">
            <input type="text" placeholder="账号" name="account" v-model="accountValue">
        </section>
        <section class="input_container">
            <input type="passWord" placeholder="密码"  v-model="passWord">
        </section>
    </form>
    <div class="login_container" @click="mobileLogin">登录</div>
    <alert-tip v-if="showAlert" :showHide="showAlert" @closeTip="closeTip" :alertText="alertText"></alert-tip>
</div>

</template>

<script>
import alertTip from '../../components/common/alertTip.vue'
import headTop from '../../components/header/head'
export default {
    components: {
        headTop,
        alertTip
    },
    data() {
        return {
            accountValue: '',
            passWord:'',
            showAlert: false, //显示提示组件
            alertText: null, //提示的内容
        }
    },
    created() {

    },
    computed: {

    },
    mounted(){

    },
    methods: {
      closeTip(){
                this.showAlert = false;
            },
      mobileLogin(){
        if(!this.accountValue){
          this.showAlert = true;
          this.alertText = "请输入账号"
          return false
        }
        if(!this.passWord){
          this.showAlert = true;
          this.alertText = "请输入密码"
          return false
        }


        let datas = {
          "account" :this.accountValue,
          "password":this.passWord
        }
        this.$http.post(this.HttpUrl.UrlConfig.login,datas)
            .then(res => {
                res = res.data
                this.showAlert = true;
                this.alertText = "2222"
            }).catch(error => {
                console.log(error)
            })
      }
    }
}

</script>
